package com.gqz.equip.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gqz.equip.app.entity.EnWzEquipBqEntity;
import com.gqz.equip.app.mapper.TEnWzEquipBqMapper;
import com.gqz.equip.app.mapstruct.TEnWzEquipBqMapstruct;
import com.gqz.equip.app.service.MqTEnWzEquipBqService;
import com.gqz.equip.vo.TEnWzEquipBqVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 新能源-物资-出入库工单表 业务逻辑实现层ServiceImpl
 *
 * @Author input you name
 */
@Service
@Slf4j
public class MqEnWzEquipBqServiceImpl extends ServiceImpl<TEnWzEquipBqMapper, EnWzEquipBqEntity> implements MqTEnWzEquipBqService {//

    @Autowired
    private TEnWzEquipBqMapstruct mapstruct;

    @Override
    public Integer update(List<TEnWzEquipBqVo> vos) {
        List<EnWzEquipBqEntity> entitys = mapstruct.toEntitys(vos);
        int result = 0;
        for (int i = 0, size = entitys.size(); i < size; i++) {
            EnWzEquipBqEntity entity = entitys.get(i);
            result += baseMapper.updateById(entity);
        }
        return result;
    }


}
